//
//  MHGLRender.h
//  MiHome
//
//  Created by CoolKernel on 08/05/2017.
//  Copyright © 2017 小米移动软件. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>
#import <AVFoundation/AVFoundation.h>
#import <UIKit/UIKit.h>
#import "MHGLProtocolGroups.h"
#import "MHGLEnum.h"

@interface MHGLRender : NSObject

- (MHGLRender *)initWithGLLayer:(CAEAGLLayer *)glLayer;
- (MHGLRender *)initWithGLLayer:(CAEAGLLayer *)glLayer otherProgramResponder:(id <MHGLProgramHandlerProtocol>)responder;

//render buffer
- (void)renderBuffer:(CVPixelBufferRef)buffer;
- (void)renderBuffer:(CVPixelBufferRef)buffer
            finished:(void (^)())finished;

- (void)willEnterForeground;
- (void)enterForeground;

- (void)enterBackground;
- (void)didEnterBackground;

- (void)flush;
- (void)flush:(MHRGBA)rgb;

- (UIImage *)snapshotPicture;
- (CIImage *)snapShot;
- (UIImage *)snapshotCorrectPicture;

- (id <MHGLProgramHandlerProtocol>)getEffectTarget;
@end
